package com.tian.convert;

import com.tian.dto.ChargeStationInfoRespDto;
import com.tian.entity.ChargeStation;

import java.util.ArrayList;
import java.util.List;

/**
 * @author tianwc  公众号：java后端技术全栈、面试专栏
 * @version 1.0.0
 * @date 2023年05月12日 11:52
 * 博客地址：<a href="http://woaijava.cc/">博客地址</a>
 * <p>
 * 充电桩数据转换
 */
public class ChargeStationConvertUtil {
    public static List<ChargeStationInfoRespDto> convert(List<ChargeStation> chargeStationList) {
        List<ChargeStationInfoRespDto> chargeStationInfoRespDtoList = new ArrayList<>();
        for (ChargeStation chargeStation : chargeStationList) {
            ChargeStationInfoRespDto chargeStationInfoRespDto = new ChargeStationInfoRespDto();
            chargeStationInfoRespDto.setId(chargeStation.getId());
            chargeStationInfoRespDto.setStationsId(chargeStation.getStationsId());
            // TODO: 2023/5/12 待转换
            chargeStationInfoRespDtoList.add(chargeStationInfoRespDto);
        }
        return chargeStationInfoRespDtoList;
    }
}
